<?php

declare(strict_types=1);

namespace App\Request\My;

use App\Request\BaseCommonRequest;
use Hyperf\Context\Context;
use Hyperf\Validation\Request\FormRequest;

class CashRecordRequest extends BaseCommonRequest
{
    /**
     * Determine if the user is authorized to make this request.
     */
    // public function authorize(): bool
    // {
    //     return true;
    // }


    /**
     * Get the validation rules that apply to the request.
     */
    public function rules(): array
    {
        return [
            'type' => 'required|in:0,1,2,3',
            'page' => 'required|integer|gte:1'
        ];
    }


    // public function messages(): array
    // {
    //     $language = Context::get('language');
    //     if ($language == 'zh-zn') {
    //         return [
    //             'type.required' => '提现记录类型必填',
    //             'type.in' => '提现记录类型错误',
    //             'page.required' => '页码必填',
    //             'page.integer' => '页码必须为整数',
    //             'page.gte' => '页码必须大于等于1'
    //         ];
    //     } elseif ($language == 'zh-hk') {
    //         return [
    //             'type.required' => '提現記錄類型必填',
    //             'type.in' => '提現記錄類型錯誤',
    //             'page.required' => '頁碼必填',
    //             'page.integer' => '頁碼必須為整數',
    //             'page.gte' => '頁碼必須大於等於1'
    //         ];
    //     } else {
    //         return [
    //             'type.required' => 'Cash record type is required',
    //             'type.in' => 'Cash record type error',
    //             'page.required' => 'Page is required',
    //             'page.integer' => 'Page must be an integer',
    //             'page.gte' => 'Page must be greater than or equal to 1'
    //         ];
    //     }
    // }
}
